{% extends "base/base.html" %}

{% comment %}

 Copyright 2013 - Tom Alessi

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and 
 limitations under the License.

{% endcomment %}

{% block content %}

<div id="help" class="reveal-modal">
  <h2>Help</h2>
  <p class="lead">{{help|safe}}</p>
  <a class="close-reveal-modal">&#215;</a>
</div>

<form enctype="multipart/form-data" method="POST" name="report" action="/report">
{% csrf_token %}

<fieldset>
  <legend>Report Incident</legend>

  <div class="row">
    <div class="large-12 columns">
      <span class="radius secondary label">Contact Information</span><br><br>
    </div>
  </div>

  <div class="row">
    <div class="large-6 columns {% if form.name.errors %}error{% endif %}">
      <input type="text" name="name" placeholder="{{instr_report_name}}" value="{% if not form.name.data == None %}{{form.name.data}}{% endif %}" />
      {% if form.name.errors %}
      <small class="error">
        {% for error in form.name.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>

    <div class="large-6 columns {% if form.email.errors %}error{% endif %}">
      <input type="text" name="email" placeholder="{{instr_report_email}}" maxlength="50" value="{% if not form.email.data == None %}{{form.email.data}}{% endif %}" />
      {% if form.email.errors %}
      <small class="error">
        {% for error in form.email.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>
  </div>

  <div class="row">
    <div class="large-12 columns">
      <span class="radius secondary label">Incident Description</span><br><br>
    </div>
  </div>

  <div class="row">
    <div class="large-12 columns {% if form.detail.errors %}error{% endif %}">
      <textarea class="small" name="detail" placeholder="{{instr_report_detail}}" maxlength="160">{% if not form.detail.data == None %}{{form.detail.data}}{% endif %}</textarea>
      {% if form.detail.errors %}
      <small class="error">
        {% for error in form.detail.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>
  </div>

  <div class="row">
    <div class="large-12 columns {% if form.extra.errors %}error{% endif %}">
      <textarea name="extra" placeholder="{{instr_report_extra}}" maxlength="1000">{% if not form.extra.data == None %}{{form.extra.data}}{% endif %}</textarea>
      {% if form.extra.errors %}
      <small class="error">
        {% for error in form.extra.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>
  </div>


  {# Only show the upload fields if this functionality is enabled #}
  {% if enable_uploads %}

  <div class="row">
    <div class="large-12 columns">
      <span class="radius secondary label">Screenshots</span><br><br>
    </div>
  </div>

  <div class="row">
    <div class="large-6 columns {% if form.screenshot1.errors %}error{% endif %}">
      {{form.screenshot1}}
      {% if form.screenshot1.errors %}
      <small class="error">
        {% for error in form.screenshot1.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>

    <div class="large-6 columns {% if form.screenshot2.errors %}error{% endif %}">
      {{form.screenshot2}}
      {% if form.screenshot2.errors %}
      <small class="error">
        {% for error in form.screenshot2.errors %}{{error}}{% endfor %}
      </small>
      {% endif %}
    </div>
  </div>

  {% endif %}

  <div class="row">
    <div class="large-12 columns">
      <input type="submit" class="small button" value="submit"/>
      &nbsp;<a href="#" data-reveal-id="help" class="small button">help</a>
    </div>
  </div>

</fieldset>
</form>


{% endblock %}



